//
// Created by ron on 2020-09-24.
//

#include "Data.h"

#include <cstdio>
#include <cstring>

unsigned int data[21];

int CheckFlag(const char* kernel)
{
    unsigned int c = 0;
    unsigned int t1 = 0;
    for (unsigned int i=0; i < 21; ++i)
    {
//        printf("i: %3d\n", i);
        if (i >= 21)
            break;

        c = kernel[i];
        t1 = c*c*c;
//        printf("%2d) %c %3d 0x%08x 0x%08x\n", i, c, c, t1, data[i]);
        if (t1 != data[i])
        {
            printf("No flag for you!\n");
            return 4;
        }
    }

    return 0;
}

void InitData()
{
    data[  0] = 0x00013693;
    data[  1] = 0x0006b2c0;
    data[  2] = 0x0011a9f9;
    data[  3] = 0x00157000;
    data[  4] = 0x0001cb91;
    data[  5] = 0x001bb528;
    data[  6] = 0x001bb528;
    data[  7] = 0x000ded21;
    data[  8] = 0x00144f38;
    data[  9] = 0x000fb89d;
    data[ 10] = 0x00169b48;
    data[ 11] = 0x000d151f;
    data[ 12] = 0x0008b98b;
    data[ 13] = 0x0017d140;
    data[ 14] = 0x000ded21;
    data[ 15] = 0x001338c0;
    data[ 16] = 0x001338c0;
    data[ 17] = 0x0011a9f9;
    data[ 18] = 0x0001b000;
    data[ 19] = 0x00144f38;
    data[ 20] = 0x001734eb;

}